var map = [];
function getMapObject(key, map) {
	var object = null;
	for (var i = 0, length = map.length; i < length; i++) {
		var entry = map[i];
		if (key === entry.name) {
			object = entry;
		}
	}
	return object;
}
function setMapValue(map, key, value) {
	var entry = getMapObject(key, map);
	if (entry == null) {
		map.push({
					name : key,
					value : value
				});
	} else {
		entry.value = value;
	}
}

function setMap(newmap) {
	for (var i = 0, length = newmap.length; i < length; i++) {
		var entry = newmap[i]; 
		if (entry != null) {
			map.push({name : entry.name,value : entry.value});
		}
	}
}

function getMapValue(key) {
	var object = null;
	for (var i = 0, length = map.length; i < length; i++) {
		var entry = map[i]; 
		if (key == entry.name) {
			object = entry.value;
		}
	}
	return object;
}
function getLanMsgs(key) {
	var object = null;
	for (var i = 0, length = map.length; i < length; i++) {
		var entry = map[i];
		if (key === entry.name) {
			object = entry.value;
		}
	}
	return object;
}